package com.zhouyu;

import com.zhouyu.service.A;
import com.zhouyu.service.B;
import com.zhouyu.service.C;
import com.zhouyu.service.D;
import org.springframework.core.OrderComparator;
import org.springframework.core.Ordered;
import org.springframework.core.annotation.AnnotationAwareOrderComparator;

import java.util.ArrayList;
import java.util.List;

/**
 * @author leimingchao
 * create 2025-05-02 21:14
 */
public class Main2 {

	public static void main(String[] args) {

		C c = new C();

		D d = new D();

		AnnotationAwareOrderComparator comparator = new AnnotationAwareOrderComparator();
		System.out.println(comparator.compare(c, d));

		List<Object> list = new ArrayList<>();
		list.add(c);
		list.add(d);

		//按order值升序排列
		list.sort(comparator);

		System.out.println(list);
	}
}
